Integrand size = 27, antiderivative size = 78 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {5 \text {arctanh}(\cos (c+d x))}{2 a^2 d}+\frac {2 \cot (c+d x)}{a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d}+\frac {2 \cos (c+d x)}{a^2 d (1+\sin (c+d x))} \]
-5/2*arctanh(cos(d*x+c))/a^2/d+2*cot(d*x+c)/a^2/d-1/2*cot(d*x+c)*csc(d*x+c )/a^2/d+2*cos(d*x+c)/a^2/d/(1+sin(d*x+c))
Leaf count is larger than twice the leaf count of optimal. \(364\) vs. \(2(78)=156\).
Time = 1.21 (sec) , antiderivative size = 364, normalized size of antiderivative = 4.67 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {4 \sin \left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}{d (a+a \sin (c+d x))^2}+\frac {\cot \left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}{d (a+a \sin (c+d x))^2}-\frac {\csc ^2\left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}{8 d (a+a \sin (c+d x))^2}-\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}{2 d (a+a \sin (c+d x))^2}+\frac {5 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}{2 d (a+a \sin (c+d x))^2}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}{8 d (a+a \sin (c+d x))^2}-\frac {\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4 \tan \left (\frac {1}{2} (c+d x)\right )}{d (a+a \sin (c+d x))^2} \]
(-4*Sin[(c + d*x)/2]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^3)/(d*(a + a*Si n[c + d*x])^2) + (Cot[(c + d*x)/2]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^4 )/(d*(a + a*Sin[c + d*x])^2) - (Csc[(c + d*x)/2]^2*(Cos[(c + d*x)/2] + Sin [(c + d*x)/2])^4)/(8*d*(a + a*Sin[c + d*x])^2) - (5*Log[Cos[(c + d*x)/2]]* (Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^4)/(2*d*(a + a*Sin[c + d*x])^2) + (5 *Log[Sin[(c + d*x)/2]]*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^4)/(2*d*(a + a*Sin[c + d*x])^2) + (Sec[(c + d*x)/2]^2*(Cos[(c + d*x)/2] + Sin[(c + d*x) /2])^4)/(8*d*(a + a*Sin[c + d*x])^2) - ((Cos[(c + d*x)/2] + Sin[(c + d*x)/ 2])^4*Tan[(c + d*x)/2])/(d*(a + a*Sin[c + d*x])^2)
Time = 0.44 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.90, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3042, 3353, 3042, 3445, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a \sin (c+d x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)^2}{\sin (c+d x)^3 (a \sin (c+d x)+a)^2}dx\) |
\(\Big \downarrow \) 3353 |
\(\displaystyle \frac {\int \frac {\csc ^3(c+d x) (a-a \sin (c+d x))}{\sin (c+d x) a+a}dx}{a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a-a \sin (c+d x)}{\sin (c+d x)^3 (\sin (c+d x) a+a)}dx}{a^2}\) |
\(\Big \downarrow \) 3445 |
\(\displaystyle \frac {\int \left (\csc ^3(c+d x)-2 \csc ^2(c+d x)+2 \csc (c+d x)-\frac {2}{\sin (c+d x)+1}\right )dx}{a^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {5 \text {arctanh}(\cos (c+d x))}{2 d}+\frac {2 \cot (c+d x)}{d}+\frac {2 \cos (c+d x)}{d (\sin (c+d x)+1)}-\frac {\cot (c+d x) \csc (c+d x)}{2 d}}{a^2}\) |
((-5*ArcTanh[Cos[c + d*x]])/(2*d) + (2*Cot[c + d*x])/d - (Cot[c + d*x]*Csc [c + d*x])/(2*d) + (2*Cos[c + d*x])/(d*(1 + Sin[c + d*x])))/a^2
3.4.13.3.1 Defintions of rubi rules used
Int[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[1/b^2 Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^(m + 1)*(a - b*Sin[e + f*x]), x], x] /; Fre eQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] && (ILtQ[m, 0] || !IGtQ[ n, 0])
Int[sin[(e_.) + (f_.)*(x_)]^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m _.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[ExpandTrig[si n[e + f*x]^n*(a + b*sin[e + f*x])^m*(A + B*sin[e + f*x]), x], x] /; FreeQ[{ a, b, e, f, A, B}, x] && EqQ[A*b + a*B, 0] && EqQ[a^2 - b^2, 0] && IntegerQ [m] && IntegerQ[n]
Time = 0.32 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.12
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+10 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {16}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}}{4 d \,a^{2}}\) | \(87\) |
default | \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+10 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {16}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}}{4 d \,a^{2}}\) | \(87\) |
parallelrisch | \(\frac {20 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )-\left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-7 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+7 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-48 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}\) | \(105\) |
risch | \(\frac {5 \,{\mathrm e}^{4 i \left (d x +c \right )}-11 \,{\mathrm e}^{2 i \left (d x +c \right )}+5 i {\mathrm e}^{3 i \left (d x +c \right )}+8-3 i {\mathrm e}^{i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) d \,a^{2}}-\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d \,a^{2}}+\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d \,a^{2}}\) | \(124\) |
norman | \(\frac {\frac {10 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {1}{8 a d}+\frac {5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}-\frac {5 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d a}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}+\frac {37 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}+\frac {71 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {5 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(169\) |
1/4/d/a^2*(1/2*tan(1/2*d*x+1/2*c)^2-4*tan(1/2*d*x+1/2*c)-1/2/tan(1/2*d*x+1 /2*c)^2+4/tan(1/2*d*x+1/2*c)+10*ln(tan(1/2*d*x+1/2*c))+16/(tan(1/2*d*x+1/2 *c)+1))
Leaf count of result is larger than twice the leaf count of optimal. 246 vs. \(2 (74) = 148\).
Time = 0.28 (sec) , antiderivative size = 246, normalized size of antiderivative = 3.15 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {16 \, \cos \left (d x + c\right )^{3} + 10 \, \cos \left (d x + c\right )^{2} - 5 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 5 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left (8 \, \cos \left (d x + c\right )^{2} + 3 \, \cos \left (d x + c\right ) - 4\right )} \sin \left (d x + c\right ) - 14 \, \cos \left (d x + c\right ) - 8}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} + a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d \cos \left (d x + c\right ) - a^{2} d + {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )\right )}} \]
1/4*(16*cos(d*x + c)^3 + 10*cos(d*x + c)^2 - 5*(cos(d*x + c)^3 + cos(d*x + c)^2 + (cos(d*x + c)^2 - 1)*sin(d*x + c) - cos(d*x + c) - 1)*log(1/2*cos( d*x + c) + 1/2) + 5*(cos(d*x + c)^3 + cos(d*x + c)^2 + (cos(d*x + c)^2 - 1 )*sin(d*x + c) - cos(d*x + c) - 1)*log(-1/2*cos(d*x + c) + 1/2) - 2*(8*cos (d*x + c)^2 + 3*cos(d*x + c) - 4)*sin(d*x + c) - 14*cos(d*x + c) - 8)/(a^2 *d*cos(d*x + c)^3 + a^2*d*cos(d*x + c)^2 - a^2*d*cos(d*x + c) - a^2*d + (a ^2*d*cos(d*x + c)^2 - a^2*d)*sin(d*x + c))
\[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\int \frac {\cos ^{2}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (74) = 148\).
Time = 0.25 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.06 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {\frac {7 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {40 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1}{\frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}} - \frac {\frac {8 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{a^{2}} + \frac {20 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}}{8 \, d} \]
1/8*((7*sin(d*x + c)/(cos(d*x + c) + 1) + 40*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 1)/(a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a^2*sin(d*x + c)^3/ (cos(d*x + c) + 1)^3) - (8*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^ 2/(cos(d*x + c) + 1)^2)/a^2 + 20*log(sin(d*x + c)/(cos(d*x + c) + 1))/a^2) /d
Time = 0.34 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.49 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {20 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} + \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{4}} + \frac {32}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}} - \frac {30 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]
1/8*(20*log(abs(tan(1/2*d*x + 1/2*c)))/a^2 + (a^2*tan(1/2*d*x + 1/2*c)^2 - 8*a^2*tan(1/2*d*x + 1/2*c))/a^4 + 32/(a^2*(tan(1/2*d*x + 1/2*c) + 1)) - ( 30*tan(1/2*d*x + 1/2*c)^2 - 8*tan(1/2*d*x + 1/2*c) + 1)/(a^2*tan(1/2*d*x + 1/2*c)^2))/d
Time = 9.55 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.54 \[ \int \frac {\cot ^2(c+d x) \csc (c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a^2\,d}+\frac {5\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,a^2\,d}+\frac {20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {7\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}-\frac {1}{2}}{d\,\left (4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2\,d} \]